<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('工单反馈')"/>
    <th:block th:include="include :: jsonview-css"/>
    <th:block th:include="include :: summernote-css"/>
</head>
<body class="white-bg">
<div class="ibox float-e-margins">
    <div class="ibox-title ">
        <h5>工单反馈</h5>
        <div class="ibox-content">
            <form class="form-horizontal" id="signupForm" method="post" action="/order/order_fankui">

                <div class="form-group">
                    <input id="order_content" required name="msg" type="hidden">
                    <input th:value="${orderListVo.orderId}" name="orderId" type="hidden" id="orderId" required
                           class="form-control">
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">工单标题：</label>
                    <div class="form-control-static" th:text="${orderListVo.orderTitle}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">工单状态: </label>
                    <div class="form-control-static" th:class=" 'label label-primary'"
                         th:text="${orderListVo.orderStatus}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">工单类型：</label>
                    <div class="form-control-static" th:text="${orderListVo.typeName}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">工单创建时间：</label>
                    <div class="form-control-static" th:text="${orderListVo.orderCreateTime}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">工单开始时间：</label>
                    <div class="form-control-static" th:text="${orderListVo.orderStartTime}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">工单结束时间：</label>
                    <div class="form-control-static" th:text="${orderListVo.orderEndTime}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">工单实际结束时间：</label>
                    <div class="form-control-static" th:text="${orderListVo.orderFinishTime}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">工单金额：</label>
                    <div class="form-control-static" th:text="${orderListVo.orderMoney}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">发布者：</label>
                    <div class="form-control-static" th:text="${orderListVo.publisher}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">审核者：</label>
                    <div class="form-control-static" th:text="${orderListVo.checker}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">审核状态：</label>
                    <div class="form-control-static" th:text="${orderListVo.checkStatus}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">接单人：</label>
                    <div class="form-control-static" th:text="${orderListVo.worker}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">客户：</label>
                    <div class="form-control-static" th:utext="${orderListVo.customer}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">工单内容：</label>
                    <div class="form-control-static" th:utext="${orderListVo.orderContent}">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">工单评价：</label>
                    <div class="form-control-static" th:text="${orderListVo.orderComment}">
                    </div>
                </div>
                <hr>

                <div class="form-group">
                    <div class="col-sm-2"></div>
                    <div class="col-sm-6">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <h1>工单留言</h1>
                                <h3>(可编辑图片,编辑完必须点保存再提交!!!)</h3>
                                <button class="btn btn-primary btn-xs m-l-sm" onclick="edit()" type="button">编辑</button>
                                <button class="btn btn-primary  btn-xs" onclick="save()" type="button">保存</button>
                            </div>
                            <div class="ibox-content" id="eg">
                                <div class="click2edit wrapper">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-2"></div>
                    <div class="col-sm-6">
                        <button type="submit" onclick="return submitForm()" style="width: 100%"
                                class="btn btn-w-m btn-lg btn-primary">留言
                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: jsonview-js"/>
<th:block th:include="include :: summernote-js"/>

<script th:inline="javascript">
    $(document).ready(function () {
        $('.summernote').summernote({
            lang: 'zh-CN'
        });
        $('.click2edit').summernote({
            lang: 'zh-CN',
            height: 150
        });
        var tip = [[${tip}]];
        if (tip != null && tip != '') {
            $.modal.msgSuccess(tip)
        }

    });

    function edit() {
        $("#eg").addClass("no-padding");
        $('.click2edit').summernote({
            lang: 'zh-CN',
            focus: true
        });
    }

    function save() {
        $("#eg").removeClass("no-padding");
        var aHTML = $('.click2edit').summernote('code');
        $('.click2edit').summernote('destroy');
        $('#order_content').val(aHTML)
    }

    function submitForm() {
        if ($('#selectWork').val() == '') {
            $.modal.msgError('提交失败,请选择接单人');
            return false;
        }
        if ($('#order_content').val() == '') {
            $.modal.msgError('提交失败,请输入任务内容');
            return false;
        }
        save()
        return true
    }
</script>
</body>
</html>